<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title>添加笔记</title>
    <#include "../common/link_css.ftl">
</head>
<body>
<!-- 导航 -->
<#include "../common/nav.ftl">
<!-- 笔记添加区域 -->
<div class="m-container-small m-padded-tb-big">
    <div class="ui container">
        <form action="/note/save" method="post" class="ui form">
            <div class="required field">
                <div class="ui left labeled input">
                    <div class="ui selection compact teal basic dropdown label">
                        <input type="hidden" value="原创">
                        <i class="dropdown icon"></i>
                        <div class="text">原创</div>
                        <div class="menu">
                            <div class="item" data-value="原创">原创</div>
                            <div class="item" data-value="转载">转载</div>
                            <div class="item" data-value="翻译">翻译</div>
                        </div>
                    </div>
                    <input type="text" name="title" placeholder="标题">
                </div>
            </div>

            <div class="field">
                <div id="md-content" style="z-index: 1 !important;">
            <textarea placeholder="博客内容" name="mdContent" style="display: none">
              [TOC]

#### Disabled options

- TeX (Based on KaTeX);
- Emoji;
- Task lists;
- HTML tags decode;
- Flowchart and Sequence Diagram;
            </textarea>
                </div>
            </div>

            <div class="two fields">
                <div class="field">
                    <div class="ui left labeled action input">
                        <label class="ui compact teal basic label">分类</label>
                        <div class="ui fluid selection dropdown">
                            <input type="hidden" name="category">
                            <i class="dropdown icon"></i>
                            <div class="default text">分类</div>
                            <div class="menu">
                                <div class="item" data-value="1">错误日志</div>
                                <div class="item" data-value="2">开发者手册</div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="field">
                    <div class="ui left labeled action input">
                        <label class="ui compact teal basic label">标签</label>
                        <div class="ui fluid selection multiple search  dropdown">
                            <input type="hidden" name="tag">
                            <i class="dropdown icon"></i>
                            <div class="default text">标签</div>
                            <div class="menu">
                                <div class="item" data-value="1">java</div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="ui error message"></div>

            <div class="ui right aligned container">
                <button type="button" class="ui button" onclick="window.history.go(-1)">返回</button>
                <button class="ui secondary button" type="submit">保存</button>
            </div>

        </form>
    </div>
</div>
<!-- 底部 -->
<#include "../common/footer.ftl">
<#include "../common/link_js.ftl">
<script>
    //初始化Markdown编辑器
    var contentEditor;
    $(function() {
        contentEditor = editormd("md-content", {
            width   : "100%",
            height  : 640,
            syncScrolling : "single",
            path    : "plugins/editormd/lib/"
        });
    });
    $('.menu.toggle').click(function () {
        $('.m-item').toggleClass('m-mobile-hide');
    });

    $('.ui.dropdown').dropdown({
        on : 'hover'
    });
    $('.ui.dropdown').dropdown({
        on : 'hover'
    });
    $('.ui.form').form({
        fields : {
            title : {
                identifier: 'title',
                rules: [{
                    type : 'empty',
                    prompt: '标题：请输入博客标题'
                }]
            }
        }
    });

</script>
</body>
</html>